<%@ page language="java" import="java.text.*, java.util.*, com.zjut.zs.util.tools.*,com.zjut.zs.applyview.manager.*, com.zjut.zs.applyview.dao.*,
com.zjut.zs.user.manager.*, com.zjut.zs.user.dao.*,com.zjut.zs.exvalue.manager.*,com.zjut.zs.exvalue.dao.*,com.zjut.zs.cj.manager.*, com.zjut.zs.cj.dao.*,
com.zjut.an.util.tools.*,com.zjut.an.util.system.*,com.zjut.zs.xy.manager.*, com.zjut.zs.xy.dao.*,com.zjut.zs.zxlb.manager.*, com.zjut.zs.zxlb.dao.*,
com.zjut.zs.hjqk.manager.*, com.zjut.zs.hjqk.dao.*,com.zjut.an.news.manager.*, com.zjut.an.news.dao.*, 
com.zjut.zs.exvalue.dao.*,com.zjut.zs.coname.manager.*, com.zjut.zs.school.manager.*, com.zjut.zs.school.dao.*,com.zjut.zs.userstatus.manager.*, com.zjut.zs.userstatus.dao.*,
com.zjut.zs.shhd.manager.*, com.zjut.zs.shhd.dao.*,com.zjut.an.config.manager.*, com.zjut.an.config.dao.*,
com.zjut.zs.applyview.dao.*,com.zjut.zs.applyview.manager.*" pageEncoding="utf-8"%>
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">  
<meta name="renderer" content="webkit"> 
<title></title>
<script src="css/tailwindcss.css"></script>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="css/table.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="../plugins/assets/plugins/jquery-3.5.1.min.js"></script>
<script type="text/javascript">
function printHtml(html) {
	var bodyHtml = document.body.innerHTML;
	document.body.innerHTML = html;
	window.print();
	document.body.innerHTML = bodyHtml;
}
function onprint() {
	var html = $("#container").html();
	printHtml(html);
}
</script>
</head>

<body>
<jsp:include page="zs_uservalidate.jsp" flush="true"/>
<%	
if (session.getAttribute("zsUser") == null&&session.getAttribute("admin") == null&&session.getAttribute("user") == null) {
	out.print("<script>alert('由于长时间未操作，系统已经自动注销，请重新登陆');</script>");
	out.print("<script>top.window.location='main.jsp';</script>");
} else {
AnNewsManager nmanager = (AnNewsManager) SpringContextUtil.getBean("AnNewsManager");
AnConfigManager anconfig = (AnConfigManager) SpringContextUtil.getBean("AnConfigManager");
ZsApplyViewManager amanager = (ZsApplyViewManager) SpringContextUtil.getBean("ZsApplyViewManager");
ZsSchoolManager zsManager = (ZsSchoolManager) SpringContextUtil.getBean("ZsSchoolManager");
ZsCoNameManager comanager = (ZsCoNameManager) SpringContextUtil.getBean("ZsCoNameManager");
ZsExValueManager evmanager = (ZsExValueManager) SpringContextUtil.getBean("ZsExValueManager");
ZsApplyViewManager uimanager = (ZsApplyViewManager) SpringContextUtil.getBean("ZsApplyViewManager");
ZsZxlbManager zmanager = (ZsZxlbManager) SpringContextUtil.getBean("ZsZxlbManager");
ZsHjqkManager hmanager = (ZsHjqkManager) SpringContextUtil.getBean("ZsHjqkManager");
ZsShhdManager smanager = (ZsShhdManager) SpringContextUtil.getBean("ZsShhdManager");
ZsCjManager cmanager = (ZsCjManager) SpringContextUtil.getBean("ZsCjManager");
ZsXyManager xmanager = (ZsXyManager) SpringContextUtil.getBean("ZsXyManager");
ZsUserManager umanager = (ZsUserManager) SpringContextUtil.getBean("ZsUserManager");
ZsUserStatusManager zsmanager = (ZsUserStatusManager) SpringContextUtil.getBean("ZsUserStatusManager");
ZsHTMLCreat html = (ZsHTMLCreat) SpringContextUtil.getBean("ZsHTMLCreat");

ZsSchool school = new ZsSchool();
school = (ZsSchool)zsManager.getDataByInstance(1,1,null,null,school).getObjects().get(0);
ZsApplyView appview = new ZsApplyView();
ZsUser user = null;
ZsZxlb zxlb = new ZsZxlb();
ZsHjqk hjqk = new ZsHjqk();
ZsShhd shhd = new ZsShhd();

if((session.getAttribute("admin")!=null||session.getAttribute("user")!=null) && request.getParameter("usId")!=null) {
	String usId = request.getParameter("usId");
	user = umanager.getData(usId);
	zxlb.setZsUser(user);
	hjqk.setZsUser(user);
	shhd.setZsUser(user);
} else if (session.getAttribute("zsUser")!=null) {
	user = umanager.getData(((ZsUser)session.getAttribute("zsUser")).getUsId());
	zxlb.setZsUser(user);
	hjqk.setZsUser(user);
	shhd.setZsUser(user);
} 
	List zlist = zmanager.getDataByInstance(1,100,null,null,zxlb).getObjects();
	List hlist = hmanager.getDataByInstance(1,100,null,null,hjqk).getObjects();
	List slist = smanager.getDataByInstance(1,100,null,null,shhd).getObjects();

if (user!=null) {
	appview = amanager.getData(user.getUsId());
}
//String receiveno = anconfig.getSingleConfigInfoByName("报名号前缀") + user.getUsNo();

List zxlist = new ArrayList();
if (user!=null) {
	zxlb.setZsUser(user);
	zxlist = zmanager.getDataByInstance(1,100,null,null,zxlb).getObjects();
}
StringBuffer zxstring = new StringBuffer();
for(int i=0; i<zxlist.size(); i++) {
	zxlb = (ZsZxlb)zxlist.get(i);
	zxstring.append(zxlb.getZxType()+";");
}
%>
<div class="max-w-8xl mx-auto px-4 py-6">
	<div class="h-100 mb-4 text-right">
		<button id="button" onclick="onprint()" class="flex items-center px-8 py-4 bg-blue-600 text-white rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors duration-200 text-xl ml-auto">打印</button>
	</div>
	<!-- 填写需知 -->
	<div class="w-full px-4 mb-4">
		<div class="bg-blue-50 border border-blue-200 rounded-lg p-4 mb-4">
			<h3 class="text-lg font-semibold text-blue-900 mb-3 flex items-center">
				<svg class="w-5 h-5 text-blue-600 mr-2" fill="currentColor" viewBox="0 0 20 20">
					<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"/>
				</svg>
				填写说明
			</h3>
			<div class="text-blue-800 text-sm">
				<%out.print(anconfig.getSingleConfigInfoByName("申请表打印需知")); %>
			</div>
		</div>
	</div>

<div id="container" class="container" style="width:100%;margin:0 auto;">
    
  		<div style="text-align:center"><h1>
  	 	<%if(Status.SENDSTATUS_YES.getStatus().equals(appview.getSendStatus())) { 
  		  		out.println(anconfig.getSingleConfigInfoByName("申请表名称"));
  		  } else {
  		  		out.println(anconfig.getSingleConfigInfoByName("申请表名称") + "<br>此为预览表，检查所有信息正确无误后请于左边菜单中'提交报考申请'生成正式申请表 "); 
  		  }
  		%>
  		</h1></div>
  		<table width="1000" class="toptable" style="margin:0 auto;">
    		  <tr>
		        <td>
		        <div style="width:190px;float:left;">网上报名编号：<%=user.getUsNo() %></div>
		        <div <%if(appview.getInZydm01().trim().length()==0)out.print("style='display:none'"); %> style="width:190px;float:left;"><%=comanager.getDataByCoEn("inZymc01").getCoCn() %>:
		        <%=appview.getInZymc01() %></div>
		        <div <%if(appview.getInZydm02().trim().length()==0)out.print("style='display:none'"); %> style="width:190px;float:left;"><%=comanager.getDataByCoEn("inZymc02").getCoCn() %>:
		        <%=appview.getInZymc02() %></div>
		        <div <%if(appview.getInZydm03().trim().length()==0)out.print("style='display:none'"); %> style="width:190px;float:left;"><%=comanager.getDataByCoEn("inZymc03").getCoCn() %>:
		        <%=appview.getInZymc03() %></div>
		        <div <%if(appview.getInZydm04().trim().length()==0)out.print("style='display:none'"); %> style="width:190px;float:left;"><%=comanager.getDataByCoEn("inZymc04").getCoCn() %>:
		        <%=appview.getInZymc04() %></div>
		        <div <%if(appview.getInZydm05().trim().length()==0)out.print("style='display:none'"); %> style="width:190px;float:left;"><%=comanager.getDataByCoEn("inZymc05").getCoCn() %>:
		        <%=appview.getInZymc05() %></div>
		        <div <%if(appview.getInZydm06().trim().length()==0)out.print("style='display:none'"); %> style="width:190px;float:left;"><%=comanager.getDataByCoEn("inZymc06").getCoCn() %>:
		        <%=appview.getInZymc06() %></div>
		        <div <%if(appview.getInZydm07().trim().length()==0)out.print("style='display:none'"); %> style="width:190px;float:left;"><%=comanager.getDataByCoEn("inZymc07").getCoCn() %>:
		        <%=appview.getInZymc07() %></div>
		        <div <%if(appview.getInZydm08().trim().length()==0)out.print("style='display:none'"); %> style="width:190px;float:left;"><%=comanager.getDataByCoEn("inZymc08").getCoCn() %>:
		        <%=appview.getInZymc08() %></div>
		        <div <%if(appview.getInZydm09().trim().length()==0)out.print("style='display:none'"); %> style="width:190px;float:left;"><%=comanager.getDataByCoEn("inZymc09").getCoCn() %>:
		        <%=appview.getInZymc09() %></div>
		        <div <%if(appview.getInZydm10().trim().length()==0)out.print("style='display:none'"); %> style="width:190px;float:left;"><%=comanager.getDataByCoEn("inZymc10").getCoCn() %>:
		        <%=appview.getInZymc10() %></div>
		        
		        <div <%if(!Status.YES.getStatus().equals(comanager.getDataByCoEn("inXxbz1").getListPermit()))out.print("style='display:none'"); %> style="width:190px;float:left;"><%=comanager.getDataByCoEn("inXxbz1").getCoCn() %>：<%=html.getInputString(appview.getInXxbz1()) %></div>
		        <div <%if(!Status.YES.getStatus().equals(comanager.getDataByCoEn("inXxbz2").getListPermit()))out.print("style='display:none'"); %> style="width:190px;float:left;"><%=comanager.getDataByCoEn("inXxbz2").getCoCn() %>：<%=html.getInputString(appview.getInXxbz2()) %></div>
		        <div <%if(!Status.YES.getStatus().equals(comanager.getDataByCoEn("inXxbz3").getListPermit()))out.print("style='display:none'"); %> style="width:190px;float:left;"><%=comanager.getDataByCoEn("inXxbz3").getCoCn() %>：<%=html.getInputString(appview.getInXxbz3()) %></div>

		        </td>
		      </tr>
   		</table>
   		<table width="1000" class="gridtable" style="margin-bottom:0px;margin:0 auto;">
   		  <tr>
   		    <td>姓　名：</td>
   		    <td><%=user.getUsName() %></td>
   		    <td>性　别：</td>
   		    <td><%=appview.getInXb() %></td>
   		    <td>民　族：</td>
   		    <td><%=appview.getInMz() %></td>
   		    <td rowspan="9" align="center" valign="top"><img name="" src="../photo/<%=user.getUsIdcard()%>.jpg" width="200" height="240" alt="" /></td>
          </tr>
   		  <tr>
   		    <td>考生类别：</td>
   		    <td><%=appview.getInKslb() %></td>
   		    <td>政治面貌：</td>
   		    <td><%=appview.getInZzmm() %></td>
   		    <td>外语：</td>
   		    <td><%=appview.getInWyyz()%></td>
	      </tr>
   		  <tr>
   		    <td>毕业类别：</td>
   		    <td><%=appview.getInBylb()%></td>
   		    <td>科类：</td>
   		    <td><%=appview.getInKl() %></td>
   		    <td>高考序号：</td>
   		    <td><%=user.getUsBmxh() %></td>
	      </tr>
   		  <tr>
   		    <td>证件类型：</td>
   		    <td><%=appview.getInZjlx()%></td>
   		    <td>身份证号：</td>
   		    <td><%=user.getUsIdcard() %></td>
   		    <td>户籍地名称：</td>
   		    <td><%=appview.getInHjmc() %></td>
	      </tr>
   		  <tr>
   		    <td>市名称：</td>
   		    <td><%=appview.getInSdmc()%></td>
   		    <td>县名称：</td>
   		    <td><%=appview.getInSxmc()%></td>
   		    <td>报名点名称：</td>
   		    <td><%=appview.getInBmdmc()%></td>
	      </tr>
   		  <tr>
   		    <td>联系电话1：</td>
   		    <td><%=appview.getInLxdh() %></td>
   		    <td>联系电话2：</td>
			<td><%=appview.getInLxdh2() %></td>
   		    <td>毕业中学：</td>
   		    <td><%=appview.getInByxxmc() %></td>
	      </tr>
   		  <tr>
   		    <td>选考科目：</td>
   		    <td><%=appview.getInXkkm() %></td>
   		    <td>已选考科目：</td>
			<td><%=appview.getInYkxkkm() %></td>
   		    <td>专业服从：</td>
   		    <td><%=appview.getInZyfc() %></td>
	      </tr>
	      
  </table>
<%if(!Status.HIDDEN.getStatus().equals(school.getScCjActive())){ %>
<table width="1000" class="cj" style="margin-bottom:0px;margin:0 auto;">
<tr>
<td>家庭成员</td>
   		    <td>姓名</td>
			<td>工作单位</td>
   		    <td>职务</td>
   		    <td>联系电话</td>
	      </tr>
	      <tr>
   		    <td>父亲<br>(或其他监护人)</td>
   		    <td><%=html.getInputString(appview.getXyYw())%></td>
			<td><%=html.getInputString(appview.getXyWy()) %></td>
   		    <td><%=html.getInputString(appview.getXySx()) %></td>
   		    <td><%=html.getInputString(appview.getXyZz()) %></td>
	      </tr>
	      <tr>
   		    <td>母亲<br>(或其他监护人)</td>
   		    <td><%=html.getInputString(appview.getXyLs()) %></td>
			<td><%=html.getInputString(appview.getXyDl()) %></td>
   		    <td><%=html.getInputString(appview.getXyWl()) %></td>
   		    <td><%=html.getInputString(appview.getXyHx()) %></td>
</tr>
</table>
<table width="1000" class="cj" style="margin-bottom:0px;margin:0 auto;">
          <tr>
            <td colspan="8">选考成绩</td>
            </tr>
          <tr>
            <td width="112" >科目</td>
            <td width="120" >政治</td>
            <td width="128" >历史</td>
            <td width="120" >地理</td>
            <td width="120" >物理</td>
            <td width="120" >化学</td>
            <td width="124" >生物</td>
            <td width="120" >技术</td>
            </tr>
          <tr> 
            <td>选考</td>
            <td><%if(appview.getInXkkm()!=null&&appview.getInXkkm().contains("政治"))out.print("是"); %></td>
            <td><%if(appview.getInXkkm()!=null&&appview.getInXkkm().contains("历史"))out.print("是"); %></td>
            <td><%if(appview.getInXkkm()!=null&&appview.getInXkkm().contains("地理"))out.print("是"); %></td>
            <td><%if(appview.getInXkkm()!=null&&appview.getInXkkm().contains("物理"))out.print("是"); %></td>
            <td><%if(appview.getInXkkm()!=null&&appview.getInXkkm().contains("化学"))out.print("是"); %></td>
            <td><%if(appview.getInXkkm()!=null&&appview.getInXkkm().contains("生物"))out.print("是"); %></td>
            <td><%if(appview.getInXkkm()!=null&&appview.getInXkkm().contains("技术"))out.print("是"); %></td>
            </tr>
          <tr>
            <td>成绩</td>
            <td><%=html.getInputString(appview.getXyXkZz()) %></td>
            <td><%=html.getInputString(appview.getXyXkLs()) %></td>
            <td><%=html.getInputString(appview.getXyXkDl()) %></td>
            <td><%=html.getInputString(appview.getXyXkWl()) %></td>
            <td><%=html.getInputString(appview.getXyXkHx()) %></td>
            <td><%=html.getInputString(appview.getXyXkSw()) %></td>
            <td><%=html.getInputString(appview.getXyXkJs()) %></td>
            </tr>
          </table>
          <%}%>
<table width="1000" class="cj" style="margin-bottom:0px;margin:0 auto;">
          <tr>
            <td colspan="13">学业水平测试成绩</td>
            </tr>
          <tr>
            <td width="120" >科目</td>
            <td width="120" >语文</td>
            <td width="120" >数学</td>
            <td width="120" >外语</td>
            <td width="120" >思想政治</td>
            <td width="120" >历史</td>
            <td width="120" >地理</td>
            <td width="120" >物理</td>
            <td width="120" >化学</td>
            
            <td width="120" >生物</td>
            <td width="120" >技术</td>
            <td width="120" >信息</td>
            <td width="120" >通用</td>
          </tr>
          <tr>
            <td>成绩</td>
            <td><%=appview.getInYwdd() %></td>
            <td><%=appview.getInSxdd() %></td>
            <td><%=appview.getInWydd() %></td>
            <td><%=appview.getInZzdd() %></td>
            <td><%=appview.getInLsdd() %></td>
            <td><%=appview.getInDldd() %></td>
            <td><%=appview.getInWldd() %></td>
            <td><%=appview.getInHxdd() %></td>
            <td><%=appview.getInSwdd() %></td>
            <td><%=appview.getInJsdd() %></td>
            <td><%=appview.getInXxdd() %></td>
            <td><%=appview.getInTydd() %></td>
          </tr>
  </table>
  <table width="1000" class="cj" style="margin-bottom:0px;margin:0 auto;">
            <tr>
              <td colspan="5">综合素质信息</td>
            </tr>
            <tr>
              <td >类别</td>
              <td >品德表现</td>
              <td >运动健康</td>
              <td >艺术素养</td>
              <td >创新实践</td>
            </tr>
            <tr>
              <td>终评等第</td>
              <td><%=appview.getInPdbx() %></td>
              <td><%=appview.getInYdjk() %></td>
              <td><%=appview.getInYssy() %></td>
              <td><%=appview.getInCxsj() %></td>
            </tr>
  </table>
          
          
  <table width="1000" class="cj" style="margin-bottom:0px;margin:0 auto;border-bottom:1px solid;">
            <tr>
              <td>特长说明：<%=appview.getInBrtc()%></td>
    		</tr>
            <tr>
              <td>其他说明：<%=appview.getInBz()%></td>
            </tr>
            <tr>
              <td>获得证书情况：<%=appview.getInZsqk()%></td>
            </tr>
            <tr>
              <td>获得荣誉情况：<%=appview.getInHjqk()%></td>
            </tr>
          </table>
<table width="1000" class="gridtable" style="margin-bottom:10px;margin:0 auto;">
          <%if(!Status.HIDDEN.getStatus().equals(school.getScZxlbActive())){ %>
	      <tr>
   		    <td colspan="7">专项条件（严格按招生简章中的专项条件填写）</td>
          </tr>          
	      <tr>
   		    <td width="100">专项类别</td>
   		    <td>奖项级别</td>
   		    <td colspan="2">名称</td>
   		    <td>获奖时间</td>
   		    <td>等级</td>
   		    <td>颁奖单位或相应等级证书</td>
          </tr>
	      <%
   		       for (int i=0; i<zlist.size(); i++){
		    	zxlb = (ZsZxlb)zlist.get(i);
   		       %>
	      <tr>
   		    <td><%=zxlb.getZxType() %></td>
	    	<td><%=zxlb.getZxJb() %></td>
	    	<td colspan="2"><%=zxlb.getZxName() %></td>
	    	<td><%=zxlb.getZxDate() %></td>
	    	<td><%=zxlb.getZxDj() %></td>
	    	<td><%=zxlb.getZxOrg() %></td>
          </tr>
	      <%} %>
<%} %>
<%if(!Status.HIDDEN.getStatus().equals(school.getScHjqkActive())){ %>
	      <tr>
   		    <td colspan="7">获奖情况</td>
          </tr>          
	      <tr>   		    
   		    <td>奖项级别</td>
   		    <td colspan="3">名称</td>
            <td>获奖时间</td>
   		    <td>等级</td>
   		    <td>颁奖单位或相应等级证书</td>
          </tr>
	      <%
   		       for (int i=0; i<hlist.size(); i++){
		    	hjqk = (ZsHjqk)hlist.get(i);
   		       %>
	      <tr>
	    	<td><%=hjqk.getHjJb() %></td>
	    	<td colspan="3"><%=hjqk.getHjName() %></td>
            <td><%=hjqk.getHjDate() %></td>
	    	<td><%=hjqk.getHjDj() %></td>
	    	<td><%=hjqk.getHjOrg() %></td>
          </tr>
	      <%} %>
	      <%} %>
<%if(!Status.HIDDEN.getStatus().equals(school.getScShhdActive())){ %>
	      <tr>
   		    <td colspan="7">高中阶段参与的社会工作和课外活动（含活动时间、受过何种奖励、本人在活动中的职务或者职责）</td>
          </tr>
	      <tr>
   		    <td colspan="2">活动名称</td>
   		    <td>担任角色</td>
   		    <td colspan="2">活动时间</td>
   		    <td colspan="2">组织单位</td>
          </tr>
	      <%
   		       for (int i=0; i<slist.size(); i++){
		    	shhd = (ZsShhd)slist.get(i);
   		       %>
	      <tr>
   		    <td colspan="2"><%=shhd.getHdName() %></td>
	    	<td><%=shhd.getHdJs() %></td>
	    	<td colspan="2"><%=shhd.getHdDateStart() %>至<%=shhd.getHdDateEnd() %></td>
	    	<td colspan="2"><%=shhd.getHdOrg() %></td>
          </tr>
	      <%} %>
    <%} %>
    <%
	      AnNews news = new AnNews();
          news.setTitle("申请表自定义格式");
          List list = nmanager.getDataByInstance(1,1,null,null,news).getObjects();
          if(list.size()>0) {
          	news = (AnNews)list.get(0);
          	out.print("<tr><td colspan='7'>"+news.getNeContent()+"</td></tr>");
          } %>
    
      </table>

</div>

<script src="../admin/js/publicManager.js" type="text/javascript" charset="utf-8"></script> 
<script>

var loactionurl = 'zs_appprint.jsp';

var json;
var zxlb="<%=zxstring%>";
$(function(){
	$.get("../zsApplyView.action?usId=<%=user.getUsId()%>&randnum="+Math.floor(Math.random()*1000000), function(data) {
		json=data.rows;
		<%=school.getScCheckJs() %>
	});
});

</script>

<%} %>
</body>
</html>
